' This class is "generated" and will be overwritten.
' Your customizations should be made in AttachmentRecord.vb

Imports System.Data.SqlTypes
Imports BaseClasses
Imports BaseClasses.Data
Imports BaseClasses.Data.SqlProvider

Namespace Training1.Business

''' <summary>
''' The generated superclass for the <see cref="AttachmentRecord"></see> class.
''' </summary>
''' <remarks>
''' This class is not intended to be instantiated directly.  To obtain an instance of this class, 
''' use the methods of the <see cref="AttachmentTable"></see> class.
''' </remarks>
''' <seealso cref="AttachmentTable"></seealso>
''' <seealso cref="AttachmentRecord"></seealso>

<Serializable()> Public Class BaseAttachmentRecord
	Inherits PrimaryKeyRecord
	

	Public Shared Shadows ReadOnly TableUtils As AttachmentTable = AttachmentTable.Instance

	' Constructors
 
	Protected Sub New()
		MyBase.New(TableUtils)
	End Sub

	Protected Sub New(ByVal record As PrimaryKeyRecord)
		MyBase.New(record, TableUtils)
	End Sub







#Region "Convenience methods to get/set values of fields"

	''' <summary>
	''' This is a convenience method that provides direct access to the value of the record's Attachment_.AttachmentId field.
	''' </summary>
	Public Function GetAttachmentIdValue() As ColumnValue
		Return Me.GetValue(TableUtils.AttachmentIdColumn)
	End Function

	''' <summary>
	''' This is a convenience method that provides direct access to the value of the record's Attachment_.AttachmentId field.
	''' </summary>
	Public Function GetAttachmentIdFieldValue() As Int32
		Return CType(Me.GetValue(TableUtils.AttachmentIdColumn).ToInt32(), Int32)
	End Function

	''' <summary>
	''' This is a convenience method that provides direct access to the value of the record's Attachment_.FileName field.
	''' </summary>
	Public Function GetFileNameValue() As ColumnValue
		Return Me.GetValue(TableUtils.FileNameColumn)
	End Function

	''' <summary>
	''' This is a convenience method that provides direct access to the value of the record's Attachment_.FileName field.
	''' </summary>
	Public Function GetFileNameFieldValue() As String
		Return CType(Me.GetValue(TableUtils.FileNameColumn).ToString(), String)
	End Function

	''' <summary>
	''' This is a convenience method that allows direct modification of the value of the record's Attachment_.FileName field.
	''' </summary>
	Public Sub SetFileNameFieldValue(ByVal val As ColumnValue)
		Me.SetValue(val, TableUtils.FileNameColumn)
	End Sub

	''' <summary>
	''' This is a convenience method that allows direct modification of the value of the record's Attachment_.FileName field.
	''' </summary>
	Public Sub SetFileNameFieldValue(ByVal val As String)
		Dim colValue As ColumnValue = New ColumnValue(val)
		Me.SetValue(colValue, TableUtils.FileNameColumn)
	End Sub

	''' <summary>
	''' This is a convenience method that provides direct access to the value of the record's Attachment_.FileContent field.
	''' </summary>
	Public Function GetFileContentValue() As ColumnValue
		Return Me.GetValue(TableUtils.FileContentColumn)
	End Function

	''' <summary>
	''' This is a convenience method that provides direct access to the value of the record's Attachment_.FileContent field.
	''' </summary>
	Public Function GetFileContentFieldValue() As Byte()
		Return CType(Me.GetValue(TableUtils.FileContentColumn).ToBinary(), Byte())
	End Function

	''' <summary>
	''' This is a convenience method that allows direct modification of the value of the record's Attachment_.FileContent field.
	''' </summary>
	Public Sub SetFileContentFieldValue(ByVal val As ColumnValue)
		Me.SetValue(val, TableUtils.FileContentColumn)
	End Sub

	''' <summary>
	''' This is a convenience method that allows direct modification of the value of the record's Attachment_.FileContent field.
	''' </summary>
	Public Sub SetFileContentFieldValue(ByVal val As String)
		Me.SetString(val, TableUtils.FileContentColumn)
	End Sub

	''' <summary>
	''' This is a convenience method that allows direct modification of the value of the record's Attachment_.FileContent field.
	''' </summary>
	Public Sub SetFileContentFieldValue(ByVal val As Byte ())
		Dim colValue As ColumnValue = New ColumnValue(val)
		Me.SetValue(colValue, TableUtils.FileContentColumn)
	End Sub
	''' <summary>
	''' This is a convenience method that provides direct access to the value of the record's Attachment_.Description field.
	''' </summary>
	Public Function GetDescriptionValue() As ColumnValue
		Return Me.GetValue(TableUtils.DescriptionColumn)
	End Function

	''' <summary>
	''' This is a convenience method that provides direct access to the value of the record's Attachment_.Description field.
	''' </summary>
	Public Function GetDescriptionFieldValue() As String
		Return CType(Me.GetValue(TableUtils.DescriptionColumn).ToString(), String)
	End Function

	''' <summary>
	''' This is a convenience method that allows direct modification of the value of the record's Attachment_.Description field.
	''' </summary>
	Public Sub SetDescriptionFieldValue(ByVal val As ColumnValue)
		Me.SetValue(val, TableUtils.DescriptionColumn)
	End Sub

	''' <summary>
	''' This is a convenience method that allows direct modification of the value of the record's Attachment_.Description field.
	''' </summary>
	Public Sub SetDescriptionFieldValue(ByVal val As String)
		Dim colValue As ColumnValue = New ColumnValue(val)
		Me.SetValue(colValue, TableUtils.DescriptionColumn)
	End Sub



#End Region

#Region "Convenience methods to get field names"

	''' <summary>
	''' This is a convenience property that provides direct access to the value of the record's Attachment_.AttachmentId field.
	''' </summary>
	Public Property AttachmentId() As Int32
		Get 
			Return CType(Me.GetValue(TableUtils.AttachmentIdColumn).ToInt32(), Int32)
		End Get
		Set (ByVal val As Int32) 
			Dim colValue As ColumnValue = New ColumnValue(val)
			Me.SetValue(colValue, TableUtils.AttachmentIdColumn)
		End Set
	End Property


	''' <summary>
	''' This is a convenience method that can be used to determine that the column is set.
	''' </summary>
	Public ReadOnly Property AttachmentIdSpecified() As Boolean
        Get
            Dim val As ColumnValue = Me.GetValue(TableUtils.AttachmentIdColumn)
            If val Is Nothing OrElse val.IsNull Then
                Return False
            End If
            Return True
        End Get
    End Property

	''' <summary>
	''' This is a convenience method that can be used to get the default value of a column.
	''' </summary>
    Public ReadOnly Property AttachmentIdDefault() As String
        Get
            Return TableUtils.AttachmentIdColumn.DefaultValue
        End Get
    End Property

	''' <summary>
	''' This is a convenience property that provides direct access to the value of the record's Attachment_.FileName field.
	''' </summary>
	Public Property FileName() As String
		Get 
			Return CType(Me.GetValue(TableUtils.FileNameColumn).ToString(), String)
		End Get
		Set (ByVal Value As String) 
			Me.SetString(value, TableUtils.FileNameColumn)
		End Set
	End Property


	''' <summary>
	''' This is a convenience method that can be used to determine that the column is set.
	''' </summary>
	Public ReadOnly Property FileNameSpecified() As Boolean
        Get
            Dim val As ColumnValue = Me.GetValue(TableUtils.FileNameColumn)
            If val Is Nothing OrElse val.IsNull Then
                Return False
            End If
            Return True
        End Get
    End Property

	''' <summary>
	''' This is a convenience method that can be used to get the default value of a column.
	''' </summary>
    Public ReadOnly Property FileNameDefault() As String
        Get
            Return TableUtils.FileNameColumn.DefaultValue
        End Get
    End Property

	''' <summary>
	''' This is a convenience property that provides direct access to the value of the record's Attachment_.FileContent field.
	''' </summary>
	Public Property FileContent() As Byte()
		Get 
			Return CType(Me.GetValue(TableUtils.FileContentColumn).ToBinary(), Byte())
		End Get
		Set (ByVal val As Byte ()) 
			Dim colValue As ColumnValue = New ColumnValue(val)
			Me.SetValue(colValue, TableUtils.FileContentColumn)
		End Set
	End Property



	''' <summary>
	''' This is a convenience method that can be used to determine that the column is set.
	''' </summary>
	Public ReadOnly Property FileContentSpecified() As Boolean
        Get
            Dim val As ColumnValue = Me.GetValue(TableUtils.FileContentColumn)
            If val Is Nothing OrElse val.IsNull Then
                Return False
            End If
            Return True
        End Get
    End Property

	''' <summary>
	''' This is a convenience method that can be used to get the default value of a column.
	''' </summary>
    Public ReadOnly Property FileContentDefault() As String
        Get
            Return TableUtils.FileContentColumn.DefaultValue
        End Get
    End Property

	''' <summary>
	''' This is a convenience property that provides direct access to the value of the record's Attachment_.Description field.
	''' </summary>
	Public Property Description() As String
		Get 
			Return CType(Me.GetValue(TableUtils.DescriptionColumn).ToString(), String)
		End Get
		Set (ByVal Value As String) 
			Me.SetString(value, TableUtils.DescriptionColumn)
		End Set
	End Property


	''' <summary>
	''' This is a convenience method that can be used to determine that the column is set.
	''' </summary>
	Public ReadOnly Property DescriptionSpecified() As Boolean
        Get
            Dim val As ColumnValue = Me.GetValue(TableUtils.DescriptionColumn)
            If val Is Nothing OrElse val.IsNull Then
                Return False
            End If
            Return True
        End Get
    End Property

	''' <summary>
	''' This is a convenience method that can be used to get the default value of a column.
	''' </summary>
    Public ReadOnly Property DescriptionDefault() As String
        Get
            Return TableUtils.DescriptionColumn.DefaultValue
        End Get
    End Property



#End Region

End Class
End Namespace
